<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>501班绩点排行榜 - 小小明星榜</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=ZCOOL+KuaiLe&display=swap');
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'ZCOOL KuaiLe', 'Microsoft YaHei', sans-serif;
            background: linear-gradient(135deg, #FF6B6B 0%, #4ECDC4 50%, #45B7D1 100%);
            min-height: 100vh;
            position: relative;
            overflow-x: hidden;
            padding: 20px;
        }

        /* 装饰元素 */
        .decoration {
            position: fixed;
            pointer-events: none;
            z-index: 1;
        }

        .star {
            width: 30px;
            height: 30px;
            background: #FFD700;
            clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
            animation: twinkle 2s infinite;
        }

        .cloud {
            width: 100px;
            height: 40px;
            background: white;
            border-radius: 50px;
            opacity: 0.8;
            animation: float 20s infinite;
        }

        .cloud::before {
            content: '';
            position: absolute;
            width: 50px;
            height: 50px;
            background: white;
            border-radius: 50%;
            top: -25px;
            left: 10px;
        }

        .cloud::after {
            content: '';
            position: absolute;
            width: 60px;
            height: 40px;
            background: white;
            border-radius: 50%;
            top: -15px;
            right: 10px;
        }

        @keyframes twinkle {
            0%, 100% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.5; transform: scale(0.8); }
        }

        @keyframes float {
            0%, 100% { transform: translateX(-100px); }
            50% { transform: translateX(calc(100vw + 100px)); }
        }

        /* 头部样式 */
        .header {
            background: linear-gradient(135deg, #FFE66D 0%, #FF6B6B 100%);
            border-radius: 30px;
            padding: 40px;
            margin-bottom: 30px;
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
            border: 5px solid white;
            position: relative;
            z-index: 10;
            text-align: center;
        }

        .header h1 {
            color: white;
            font-size: 42px;
            margin-bottom: 10px;
            text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.2);
            animation: bounce 2s infinite;
        }

        @keyframes bounce {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-10px); }
        }

        .header .subtitle {
            color: white;
            font-size: 20px;
            text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
        }

        /* 统计卡片 */
        .stats-container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .stat-card {
            background: linear-gradient(135deg, #4ECDC4 0%, #45B7D1 100%);
            color: white;
            padding: 25px;
            border-radius: 20px;
            text-align: center;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            transition: all 0.3s;
            border: 3px solid white;
            position: relative;
            overflow: hidden;
        }

        .stat-card::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
            animation: shimmer 3s infinite;
        }

        @keyframes shimmer {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .stat-card:hover {
            transform: translateY(-10px) scale(1.05);
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
        }

        .stat-icon {
            font-size: 40px;
            margin-bottom: 10px;
        }

        .stat-number {
            font-size: 36px;
            font-weight: bold;
            margin-bottom: 5px;
            text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
        }

        .stat-label {
            font-size: 16px;
            opacity: 0.95;
        }

        /* 控制面板 */
        .controls {
            background: white;
            border-radius: 25px;
            padding: 25px;
            margin-bottom: 30px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            display: flex;
            flex-wrap: wrap;
            gap: 20px;
            align-items: center;
            border: 3px solid #FFE66D;
        }

        .search-box {
            flex: 1;
            min-width: 200px;
            position: relative;
        }

        .search-box input {
            width: 100%;
            padding: 15px 45px 15px 20px;
            border: 3px solid #4ECDC4;
            border-radius: 20px;
            font-size: 18px;
            font-family: 'ZCOOL KuaiLe', sans-serif;
            transition: all 0.3s;
            background: #f8f9fa;
        }

        .search-box input:focus {
            outline: none;
            border-color: #FF6B6B;
            transform: scale(1.02);
            box-shadow: 0 5px 20px rgba(255, 107, 107, 0.3);
        }

        .search-icon {
            position: absolute;
            right: 20px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 20px;
        }

        .filter-group {
            display: flex;
            gap: 10px;
            align-items: center;
        }

        .filter-group label {
            color: #666;
            font-weight: bold;
            font-size: 18px;
        }

        .filter-group select {
            padding: 12px 20px;
            border: 3px solid #4ECDC4;
            border-radius: 15px;
            font-size: 16px;
            cursor: pointer;
            transition: all 0.3s;
            font-family: 'ZCOOL KuaiLe', sans-serif;
            background: white;
        }

        .filter-group select:focus {
            outline: none;
            border-color: #FF6B6B;
        }

        .btn-refresh {
            background: linear-gradient(135deg, #FF6B6B 0%, #FFA500 100%);
            color: white;
            border: none;
            padding: 15px 30px;
            border-radius: 20px;
            font-size: 18px;
            cursor: pointer;
            transition: all 0.3s;
            font-weight: bold;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
            border: 3px solid white;
        }

        .btn-refresh:hover {
            transform: translateY(-5px) scale(1.1);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
        }

        /* 排行榜容器 */
        .leaderboard-container {
            background: white;
            border-radius: 30px;
            padding: 30px;
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
            border: 5px solid #FFE66D;
            position: relative;
            z-index: 10;
        }

        /* 排行榜样式 */
        .leaderboard {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .leaderboard-item {
            display: flex;
            align-items: center;
            padding: 25px;
            background: #f8f9fa;
            border-radius: 20px;
            transition: all 0.3s;
            position: relative;
            overflow: hidden;
            border: 3px solid transparent;
        }

        .leaderboard-item:hover {
            transform: translateX(15px) scale(1.02);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            border-color: #FFE66D;
        }

        /* 前三名特殊样式 */
        .leaderboard-item.top-1 {
            background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
            color: white;
            animation: glow 2s infinite;
        }

        .leaderboard-item.top-2 {
            background: linear-gradient(135deg, #C0C0C0 0%, #808080 100%);
            color: white;
        }

        .leaderboard-item.top-3 {
            background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%);
            color: white;
        }

        @keyframes glow {
            0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
            50% { box-shadow: 0 0 40px rgba(255, 215, 0, 0.8); }
        }

        /* 排名徽章 */
        .rank-badge {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 24px;
            margin-right: 25px;
            flex-shrink: 0;
            position: relative;
        }

        .top-1 .rank-badge {
            background: rgba(255, 255, 255, 0.3);
            color: white;
            box-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
            animation: pulse 1.5s infinite;
        }

        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); }
        }

        .top-2 .rank-badge,
        .top-3 .rank-badge {
            background: rgba(255, 255, 255, 0.3);
            color: white;
            box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
        }

        .rank-badge.normal {
            background: linear-gradient(135deg, #4ECDC4 0%, #45B7D1 100%);
            color: white;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
        }

        /* 学生信息 */
        .student-info {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 20px;
        }

        .student-avatar {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background: linear-gradient(135deg, #FF6B6B 0%, #FFA500 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 24px;
            font-weight: bold;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
            border: 3px solid white;
        }

        .student-details {
            flex: 1;
        }

        .student-name {
            font-size: 22px;
            font-weight: bold;
            margin-bottom: 5px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .student-id {
            font-size: 16px;
            opacity: 0.8;
        }

        .top-1 .student-id,
        .top-2 .student-id,
        .top-3 .student-id {
            color: rgba(255, 255, 255, 0.9);
        }

        /* 分数显示 */
        .score-display {
            text-align: right;
            margin-right: 20px;
        }

        .score-value {
            font-size: 32px;
            font-weight: bold;
            color: #FF6B6B;
            text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
        }

        .top-1 .score-value,
        .top-2 .score-value,
        .top-3 .score-value {
            color: white;
            text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
        }

        .score-label {
            font-size: 14px;
            color: #999;
            margin-top: 5px;
        }

        .top-1 .score-label,
        .top-2 .score-label,
        .top-3 .score-label {
            color: rgba(255, 255, 255, 0.9);
        }

        /* 趋势指示器 */
        .trend-indicator {
            font-size: 24px;
            margin-left: 10px;
            animation: bounce 1s infinite;
        }

        .trend-up {
            color: #4caf50;
        }

        .trend-down {
            color: #f44336;
        }

        .trend-same {
            color: #999;
        }

        /* 分页 */
        .pagination {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 15px;
            margin-top: 40px;
            flex-wrap: wrap;
        }

        .pagination button {
            padding: 12px 20px;
            border: 3px solid #4ECDC4;
            background: white;
            border-radius: 15px;
            cursor: pointer;
            transition: all 0.3s;
            font-size: 16px;
            font-family: 'ZCOOL KuaiLe', sans-serif;
            font-weight: bold;
        }

        .pagination button:hover:not(:disabled) {
            background: linear-gradient(135deg, #4ECDC4 0%, #45B7D1 100%);
            color: white;
            transform: translateY(-3px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
        }

        .pagination button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .pagination button.active {
            background: linear-gradient(135deg, #FF6B6B 0%, #FFA500 100%);
            color: white;
            border-color: #FF6B6B;
            transform: scale(1.1);
            box-shadow: 0 5px 20px rgba(255, 107, 107, 0.3);
        }

        .page-info {
            color: #666;
            font-size: 16px;
            font-weight: bold;
            padding: 10px 20px;
            background: #f8f9fa;
            border-radius: 15px;
            border: 2px solid #e0e0e0;
        }

        /* 加载动画 */
        .loading {
            text-align: center;
            padding: 60px;
            color: #666;
        }

        .loading-spinner {
            width: 60px;
            height: 60px;
            border: 6px solid #f3f3f3;
            border-top: 6px solid #FF6B6B;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 20px;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* 空状态 */
        .empty-state {
            text-align: center;
            padding: 60px;
            color: #999;
        }

        .empty-state-icon {
            font-size: 80px;
            margin-bottom: 20px;
            animation: wiggle 2s infinite;
        }

        @keyframes wiggle {
            0%, 100% { transform: rotate(-10deg); }
            50% { transform: rotate(10deg); }
        }

        .empty-state-text {
            font-size: 20px;
            color: #666;
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .header h1 {
                font-size: 32px;
            }

            .controls {
                flex-direction: column;
            }

            .search-box {
                width: 100%;
            }

            .filter-group {
                width: 100%;
                justify-content: space-between;
            }

            .leaderboard-item {
                padding: 20px;
            }

            .rank-badge {
                width: 50px;
                height: 50px;
                font-size: 20px;
            }

            .student-avatar {
                width: 50px;
                height: 50px;
                font-size: 20px;
            }

            .score-value {
                font-size: 28px;
            }

            .student-name {
                font-size: 20px;
            }
        }

        /* 彩虹边框动画 */
        .rainbow-border {
            position: relative;
        }

        .rainbow-border::before {
            content: '';
            position: absolute;
            inset: -5px;
            border-radius: inherit;
            padding: 5px;
            background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
            -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            -webkit-mask-composite: xor;
            mask-composite: exclude;
            animation: rainbow 3s linear infinite;
        }

        @keyframes rainbow {
            0% { filter: hue-rotate(0deg); }
            100% { filter: hue-rotate(360deg); }
        }
    </style>
</head>
<body>
    <!-- 装饰元素 -->
    <div class="decoration star" style="top: 10%; left: 10%;"></div>
    <div class="decoration star" style="top: 20%; right: 15%; animation-delay: 0.5s;"></div>
    <div class="decoration star" style="bottom: 30%; left: 5%; animation-delay: 1s;"></div>
    <div class="decoration star" style="bottom: 20%; right: 10%; animation-delay: 1.5s;"></div>
    <div class="decoration cloud" style="top: 10%; left: -100px;"></div>
    <div class="decoration cloud" style="top: 60%; right: -100px; animation-delay: 10s;"></div>

    <!-- 头部 -->
    <div class="header">
        <h1>🏆 501班绩点排行榜 🌟</h1>
        <p class="subtitle">小小明星，闪闪发光！</p>
    </div>
    
    <!-- 统计卡片 -->
    <div class="stats-container">
        <div class="stat-card">
            <div class="stat-icon">👦👧</div>
            <div class="stat-number" id="totalStudents">0</div>
            <div class="stat-label">班级人数</div>
        </div>
        <div class="stat-card">
            <div class="stat-icon">📊</div>
            <div class="stat-number" id="avgScore">0</div>
            <div class="stat-label">平均绩点</div>
        </div>
        <div class="stat-card">
            <div class="stat-icon">🌟</div>
            <div class="stat-number" id="highestScore">0</div>
            <div class="stat-label">最高绩点</div>
        </div>
        <div class="stat-card">
            <div class="stat-icon">🎯</div>
            <div class="stat-number" id="passRate">0%</div>
            <div class="stat-label">优秀率</div>
        </div>
    </div>

    <!-- 控制面板 -->
    <div class="controls">
        <div class="search-box">
            <input type="text" id="searchInput" placeholder="搜索小朋友的名字...">
            <span class="search-icon">🔍</span>
        </div>
        
        <div class="filter-group">
            <label>排序方式：</label>
            <select id="sortSelect">
                <option value="score-desc">绩点从高到低</option>
                <option value="score-asc">绩点从低到高</option>
                <option value="name-asc">名字 A-Z</option>
                <option value="name-desc">名字 Z-A</option>
            </select>
        </div>
        
        <button class="btn-refresh" onclick="refreshData()">🔄 刷新一下</button>
    </div>

    <!-- 排行榜容器 -->
    <div class="leaderboard-container">
        <div class="leaderboard" id="leaderboard">
            <!-- 动态生成排行榜内容 -->
        </div>
        
        <!-- 分页 -->
        <div class="pagination" id="pagination">
            <!-- 动态生成分页按钮 -->
        </div>
    </div>

    <script>
        // 模拟501班学生数据
        const generateStudents = () => {
            const surnames = ['张', '王', '李', '赵', '刘', '陈', '杨', '黄', '周', '吴', '徐', '孙', '马', '朱', '胡', '郭', '何', '高', '林', '罗'];
            const names = ['小明', '小红', '小华', '小丽', '小强', '小美', '小杰', '小芳', '小军', '小燕', '小宇', '小婷', '小鹏', '小慧', '小波', '小琳', '小涛', '小雪', '小辉', '小颖'];
            const students = [];
            
            for (let i = 1; i <= 35; i++) {
                const surname = surnames[Math.floor(Math.random() * surnames.length)];
                const name = names[Math.floor(Math.random() * names.length)];
                students.push({
                    id: `501${String(i).padStart(2, '0')}`,
                    name: surname + name,
                    score: (Math.random() * 2 + 3).toFixed(2), // 3.00-5.00绩点
                    class: '501',
                    trend: Math.random() > 0.5 ? 'up' : (Math.random() > 0.5 ? 'down' : 'same'),
                    previousRank: Math.floor(Math.random() * 35) + 1
                });
            }
            
            return students;
        };

        // 全局变量
        let allStudents = generateStudents();
        let filteredStudents = [...allStudents];
        let currentPage = 1;
        const itemsPerPage = 8;

        // 初始化
        function init() {
            updateStats();
            sortStudents('score-desc');
            renderLeaderboard();
            setupEventListeners();
        }

        // 更新统计信息
        function updateStats() {
            const total = filteredStudents.length;
            const avg = filteredStudents.reduce((sum, s) => sum + parseFloat(s.score), 0) / total;
            const highest = Math.max(...filteredStudents.map(s => parseFloat(s.score)));
            const excellentCount = filteredStudents.filter(s => parseFloat(s.score) >= 4.0).length;
            const passRate = (excellentCount / total * 100).toFixed(1);
            
            document.getElementById('totalStudents').textContent = total;
            document.getElementById('avgScore').textContent = avg.toFixed(2);
            document.getElementById('highestScore').textContent = highest.toFixed(2);
            document.getElementById('passRate').textContent = passRate + '%';
        }

        // 排序学生
        function sortStudents(sortType) {
            switch(sortType) {
                case 'score-desc':
                    filteredStudents.sort((a, b) => parseFloat(b.score) - parseFloat(a.score));
                    break;
                case 'score-asc':
                    filteredStudents.sort((a, b) => parseFloat(a.score) - parseFloat(b.score));
                    break;
                case 'name-asc':
                    filteredStudents.sort((a, b) => a.name.localeCompare(b.name, 'zh-CN'));
                    break;
                case 'name-desc':
                    filteredStudents.sort((a, b) => b.name.localeCompare(a.name, 'zh-CN'));
                    break;
            }
            
            // 更新排名
            filteredStudents.forEach((student, index) => {
                student.currentRank = index + 1;
            });
            
            currentPage = 1;
            renderLeaderboard();
        }

        // 搜索学生
        function searchStudents(query) {
            if (!query) {
                filteredStudents = [...allStudents];
            } else {
                query = query.toLowerCase();
                filteredStudents = allStudents.filter(student => 
                    student.name.toLowerCase().includes(query) ||
                    student.id.toLowerCase().includes(query)
                );
            }
            
            const sortType = document.getElementById('sortSelect').value;
            sortStudents(sortType);
        }

        // 渲染排行榜
        function renderLeaderboard() {
            const leaderboard = document.getElementById('leaderboard');
            const start = (currentPage - 1) * itemsPerPage;
            const end = start + itemsPerPage;
            const pageStudents = filteredStudents.slice(start, end);
            
            if (pageStudents.length === 0) {
                leaderboard.innerHTML = `
                    <div class="empty-state">
                        <div class="empty-state-icon">📭</div>
                        <div class="empty-state-text">没有找到小朋友哦~</div>
                    </div>
                `;
                return;
            }
            
            leaderboard.innerHTML = pageStudents.map((student, index) => {
                const globalRank = start + index + 1;
                let rankClass = '';
                let rankBadge = '';
                
                if (globalRank === 1) {
                    rankClass = 'top-1';
                    rankBadge = '🥇';
                } else if (globalRank === 2) {
                    rankClass = 'top-2';
                    rankBadge = '🥈';
                } else if (globalRank === 3) {
                    rankClass = 'top-3';
                    rankBadge = '🥉';
                } else {
                    rankBadge = globalRank;
                }
                
                let trendIcon = '';
                if (student.trend === 'up') {
                    trendIcon = '<span class="trend-indicator trend-up">📈</span>';
                } else if (student.trend === 'down') {
                    trendIcon = '<span class="trend-indicator trend-down">📉</span>';
                } else {
                    trendIcon = '<span class="trend-indicator trend-same">➡️</span>';
                }
                
                return `
                    <div class="leaderboard-item ${rankClass}">
                        <div class="rank-badge ${rankClass === '' ? 'normal' : ''}">${rankBadge}</div>
                        <div class="student-info">
                            <div class="student-avatar">${student.name[student.name.length - 1]}</div>
                            <div class="student-details">
                                <div class="student-name">${student.name} ${trendIcon}</div>
                                <div class="student-id">学号：${student.id}</div>
                            </div>
                        </div>
                        <div class="score-display">
                            <div class="score-value">${student.score}</div>
                            <div class="score-label">绩点</div>
                        </div>
                    </div>
                `;
            }).join('');
            
            renderPagination();
        }

        // 渲染分页
        function renderPagination() {
            const pagination = document.getElementById('pagination');
            const totalPages = Math.ceil(filteredStudents.length / itemsPerPage);
            
            if (totalPages <= 1) {
                pagination.innerHTML = '';
                return;
            }
            
            let html = '';
            
            // 上一页按钮
            html += `<button onclick="changePage(${currentPage - 1})" ${currentPage === 1 ? 'disabled' : ''}>⬅️ 上一页</button>`;
            
            // 页码按钮
            for (let i = 1; i <= totalPages; i++) {
                if (i === 1 || i === totalPages || (i >= currentPage - 2 && i <= currentPage + 2)) {
                    html += `<button onclick="changePage(${i})" class="${i === currentPage ? 'active' : ''}">${i}</button>`;
                } else if (i === currentPage - 3 || i === currentPage + 3) {
                    html += '<span>...</span>';
                }
            }
            
            // 下一页按钮
            html += `<button onclick="changePage(${currentPage + 1})" ${currentPage === totalPages ? 'disabled' : ''}>下一页 ➡️</button>`;
            
            // 页面信息
            html += `<span class="page-info">第 ${currentPage} / ${totalPages} 页</span>`;
            
            pagination.innerHTML = html;
        }

        // 切换页面
        function changePage(page) {
            const totalPages = Math.ceil(filteredStudents.length / itemsPerPage);
            if (page < 1 || page > totalPages) return;
            
            currentPage = page;
            renderLeaderboard();
            
            // 滚动到顶部
            document.querySelector('.leaderboard-container').scrollIntoView({ behavior: 'smooth' });
        }

        // 刷新数据
        function refreshData() {
            // 显示加载状态
            const leaderboard = document.getElementById('leaderboard');
            leaderboard.innerHTML = `
                <div class="loading">
                    <div class="loading-spinner"></div>
                    <div>正在加载小朋友们的成绩...</div>
                </div>
            `;
            
            // 模拟异步加载
            setTimeout(() => {
                allStudents = generateStudents();
                filteredStudents = [...allStudents];
                updateStats();
                sortStudents(document.getElementById('sortSelect').value);
            }, 1500);
        }

        // 设置事件监听器
        function setupEventListeners() {
            // 搜索
            document.getElementById('searchInput').addEventListener('input', (e) => {
                searchStudents(e.target.value);
            });
            
            // 排序
            document.getElementById('sortSelect').addEventListener('change', (e) => {
                sortStudents(e.target.value);
            });
        }

        // 页面加载完成后初始化
        document.addEventListener('DOMContentLoaded', init);
    </script>
</body>
</html>